// 清除缓存
const fs = require('fs');
let version = 1
console.log('version:', version)
const clearDir = (path) => {
    let files = [];
    if (fs.existsSync(path)) {
        files = fs.readdirSync(path);
        files.forEach((file) => {
            const curPath = `${path}/${file}`;
            if (fs.statSync(curPath).isDirectory()) { // recurse
                clearDir(curPath);
            } else { // delete file
                fs.unlinkSync(curPath);
            }
        });
        fs.rmdirSync(path);
    }
};

clearDir('./node_modules/.cache/');
clearDir('./test');
clearDir('./production');
